package com.yonyou.train;

import com.yonyou.train.filter.LoginFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;



@SpringBootApplication
//@MapperScan("com.yonyou.train")
//@MapperScan("com.yonyou.train.dao")

public class MainApplication {
    public static void main(String[] args) {
        SpringApplication.run(MainApplication.class, args);
    }

    @Bean
    public FilterRegistrationBean indexFilterRegistration() {
        FilterRegistrationBean register = new FilterRegistrationBean(new LoginFilter());
        register.addUrlPatterns("/*");
        return register;
    }
    /*@Bean
    public InterceptorRegistration addInterceptor(){
        return new InterceptorRegistry().addInterceptor(new CorsInterceptor()).addPathPatterns("/*");
    }*/
}
